package com.ilearn.iodata.iolingo.service.metadata.core.edm.mapper.api;



import com.ilearn.iodata.iolingo.service.metadata.core.edm.mapper.exception.ODataGenericModelException;

import java.util.List;

public interface GenericEnumerationAttribute {
  <T extends Enum<?>> T enumOf(final String value) throws ODataGenericModelException;

  <T extends Number, E extends Enum<E>> E enumOf(final T value) throws ODataGenericModelException;

  <T extends Number> T valueOf(final String value) throws ODataGenericModelException;

  <T extends Number> T valueOf(final List<String> value) throws ODataGenericModelException;

  boolean isFlags() throws ODataGenericModelException;

  /**
   * Converts a list of string representations either into an array of enumerations, if a converter is given, or
   * otherwise the first value into an enumeration
   * @param value
   * @return
   * @throws ODataGenericModelException
   */
  Object convert(final List<String> values) throws ODataGenericModelException;

}
